package com.eurabia.eggchat.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.eurabia.eggchat.pojo.SysEggchatColumn;
import com.eurabia.eggchat.pojo.form.SysEggchatColumnForm;
import com.eurabia.eggchat.pojo.query.SysEggchatColumnQuery;
import com.eurabia.eggchat.dao.SysEggchatColumnDao;
import com.eurabia.eggchat.service.SysEggchatColumnService;

import javax.annotation.Resource;


/**
 * SysEggchatColumnService 
 */
@Service
public class SysEggchatColumnServiceImpl implements SysEggchatColumnService {
    @Resource
    private SysEggchatColumnDao sysEggchatColumnDao;
	
	/**
     * 查询 SysEggchatColumn
     */
	@Override
    public List<SysEggchatColumn> find(final SysEggchatColumnQuery query) {
        return sysEggchatColumnDao.find(query);
    }
    
    /**
     * 分页查询 SysEggchatColumn
     */
    @Override
    public Page<SysEggchatColumn> findByPage(final SysEggchatColumnQuery query) {
        PageHelper.startPage(query.getPage().intValue(), query.getLimit().intValue());
        return (Page<SysEggchatColumn>) sysEggchatColumnDao.find(query);
    }

    /**
     * 通过id得到一个 SysEggchatColumn
     */
    @Override
    public SysEggchatColumn get(final String id) {
        return sysEggchatColumnDao.get(id);
    }
    
    /**
     * 新增 SysEggchatColumn
     */
    @Override
    public void add(final SysEggchatColumnForm form) {
        sysEggchatColumnDao.add(form);
    }

    /**
     * 修改 SysEggchatColumn
     */
    @Override
    public int update(final SysEggchatColumnForm form) {
        return sysEggchatColumnDao.update(form);
    }
    
    /**
     * 删除一个 SysEggchatColumn
     */
    @Override
    public int delete(final String id) {
        return sysEggchatColumnDao.delete(id);
    }
	
	/**
     * 修改是否可用
     */
    @Override
    public int changeEnabled(final String id, final Integer enabled) {
        return sysEggchatColumnDao.changeEnabled(id, enabled);
    }
}